package Java.BlackHorse.IO;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class IODemo6 {
    public static void main(String[] args) throws IOException {

        long start = System.currentTimeMillis();

        FileInputStream fis = new FileInputStream("IO\\a.txt");
        FileOutputStream fos = new FileOutputStream("IO\\b.txt");
        byte[] read = new byte[1024 * 5];//每次读取 5 mb
        int len;
        while((len = fis.read(read)) > 0){
            fos.write(read,0,len);
        }

        long end = System.currentTimeMillis();
        System.out.println( end-start + "ms" );

        fos.close();
        fis.close();
    }
}
